package 对象适配器模式;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.FlowPane;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class Test extends Application{
	Adapter ada=new Adapter();
     public static void main(String[] args) {
          launch(args);
     }
	public void start(Stage primaryStage) {
         primaryStage.setTitle("变压器");
         Button btn = new Button();
         btn.setText("开始变压");
        TextField txt=new TextField();
        TextField txt1=new TextField();
      	txt.setMinWidth(250);
      	txt.setMinHeight(20);
      	txt1.setMinWidth(250);
      	txt1.setMinHeight(20);
      	
      	String str=ada.V220();
      	txt.setText(str);
         btn.setOnAction(new EventHandler<ActionEvent>() {
             @Override
             public void handle(ActionEvent event) {
                  Test();
                  txt1.setText(Test());
             }
         });
         FlowPane pane = new FlowPane();  
         pane.setPadding(new Insets(11, 12, 13, 14));
         pane.setHgap(15);//水平距离
         pane.setVgap(5);//垂直距离
         pane.getChildren().add(txt); 
         pane.getChildren().add(btn);
         pane.getChildren().add(txt1);
         
         primaryStage.setScene(new Scene(pane, 350, 350));
         primaryStage.show();
	}
	public String Test()
	{
	       String str1=ada.V5();
	       return str1;
	}
}
